package P086_swithAddError;

import org.junit.Test;

/**
 * @Description : swith default代码块中添加 AssertionError错误
 *
 **/
public class SwitchDefaultError {

    /**
     * swith语句先计算season变量的排序值，然后与枚举常量的每个值排序
     */
    @Test
    public void test(){
       doSports(Season.Autumn);
    }

    public void doSports(Season season){

        switch(season){
            case Spring:
                System.out.println("春天"); break;
            case Summer:
                System.out.println("夏天"); break;
            default:
                System.out.println("错误"); break;
        }
    }

    enum Season{
        Spring,Summer,Autumn,Winter;
        public static Season getComfortableSeason(){
            return Spring;
        }
    }


}
